# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Jan de Groot <jan@archlinux.org>

pkgname=gnome-desktop
pkgver=40.4
pkgrel=1
epoch=1
pkgdesc="Library with common API for various GNOME modules"
url="https://gitlab.gnome.org/GNOME/gnome-desktop"
arch=(x86_64)
license=(GPL LGPL)
depends=(gsettings-desktop-schemas gtk3 xkeyboard-config iso-codes libseccomp
         bubblewrap systemd libxkbcommon)
makedepends=(gobject-introspection git meson gtk-doc yelp-tools)
checkdepends=(xorg-server-xvfb)
provides=(libgnome-desktop-3.so)
_commit=2623601b332ebb2b809b6b77d70c8702330409eb  # tags/40.4^0
source=("git+https://gitlab.gnome.org/GNOME/gnome-desktop.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgname
}

build() {
  arch-meson $pkgname build \
    -D gnome_distributor="Arch Linux" \
    -D gtk_doc=true \
    -D debug_tools=false \
    -D date_in_gnome_version=false
  meson compile -C build
}

check() {
  dbus-run-session xvfb-run -s '-nolisten local' \
    meson test -C build --print-errorlogs
}

package() {
  meson install -C build --destdir "$pkgdir"
}
